package com.hpin.mlxteacher.child;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;

import com.hpin.mlxteacher.R;
import com.hpin.mlxteacher.adapter.ChildAdapter;
import com.hpin.mlxteacher.base.BaseActivity;

/**
 * 孩子列表页面
 * Created by Aaron on 15/7/29.
 */
public class ChildListActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_child_list);

        initWidget();

    }

    private void initWidget() {

        TextView tv_left = (TextView) findViewById(R.id.tv_left);
        TextView tv_title = (TextView) findViewById(R.id.tv_title);
        TextView tv_right = (TextView) findViewById(R.id.tv_right);


        tv_left.setText(getResources().getString(R.string.work));
        tv_title.setText(getResources().getString(R.string.rl_child));
        tv_right.setText(getResources().getString(R.string.map));

        ListView lv_child = (ListView) findViewById(R.id.lv_child);

        ChildAdapter adapter = new ChildAdapter(this);
        lv_child.setAdapter(adapter);

        tv_left.setOnClickListener(this);
        tv_right.setOnClickListener(this);
    }

    @Override
    public void widgetClick(View v) {
        switch (v.getId()) {

            case R.id.tv_left :

                Intent intent = new Intent(this, WorkActivity.class);
                startActivity(intent);
                finish();

                break;
            case R.id.tv_right :

                finish();

                break;

        }
    }
}
